home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
a_utils
/
expanded.lha
/
test_suite
/
testmulti.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-03-19
|
37KB
|
1,162 lines
//
// Linear-Affine-Projective Geometry Package
//
// testmulti.C
//
// $Header$
//
// William J.R. Longabaugh
// University of Washington
//
// Test programs for the linear-affine-projective geometry
// package described in William J.R. Longabaugh, "An Expanded
// System for Coordinate-Free Geometric Programming", Master's
// thesis, University of Washington, 1992.
//
// Copyright (c) 1992, William J.R. Longabaugh
// Copying, use and development for non-commercial purposes permitted.
// All rights for commercial use reserved.
// This software is unsupported and without warranty; it is
// provided "as is".
//
// ***********************************************************************
#include "Lap.h"
#include <math.h>
extern void test1(void);
extern void test2(void);
extern void test3(void);
extern void test4(void);
extern void test5(void);
extern void test6(void);
extern void test7(void);
extern void test8(void);
extern void test9(void);
extern void test10(void);
extern void test11(void);
extern void truth(Boolean res, Boolean expect);
extern void beauty(void);
static int count = 0;
// ***********************************************************************
void truth(Boolean res, Boolean expect)
{
if (res != expect) {
cout << "Failure at: " << count << "\n";
}
count++;
}
// ***********************************************************************
void beauty(void)
{
cout << "Now at: " << count << "\n";
}
// ***********************************************************************
int main(void)
{
test1();
test2();
test3();
test4();
test5();
test6();
test7();
test8();
test9();
test10();
test11();
return (0);
}
// ***********************************************************************
// Quadratic surface:
void test1(void)
{
cout << "ENTERING TEST1\n";
beauty();
ASpace param("paramspace", 2, TRUE);
Simplex smp1 = param.StdSimplex();
APoint s1(smp1, ScalarList(0.4, 0.3, 0.3));
APoint s2(smp1, ScalarList(1.5, 2.0, -2.5));
APoint s3(smp1, ScalarList(0.9, -0.3, 0.4));
Simplex mysimp("my simplex", param, GeObList(s1, s2, s3));
ASpace rng("rngspace", 3, TRUE);
Frame fr2 = rng.StdBasis();
ASpace domsp("testdom", SpaceList(param, 2), FALSE);
IntList hold(1);
hold[0] = 2;
APoint aa(fr2, ScalarList(0.0, 0.0, 0.0, 1.0));
APoint ab(fr2, ScalarList(1.0, 0.0, 0.3, 1.0));
APoint bb(fr2, ScalarList(2.0, 0.0, 0.0, 1.0));
APoint ac(fr2, ScalarList(0.5, 1.0, 0.3, 1.0));
APoint bc(fr2, ScalarList(1.5, 1.0, 0.3, 1.0));
APoint cc(fr2, ScalarList(1.0, 2.0, 0.0, 1.0));
GeObList net = GeObList(aa, ab, bb) + GeObList(ac, bc, cc);
MAM tstmp(domsp, hold, BasisList(mysimp), rng, net);
APoint pt1(mysimp, ScalarList(1.0, 0.0, 0.0));
APoint pt2(mysimp, ScalarList(0.0, 1.0, 0.0));
APoint pt3(mysimp, ScalarList(0.0, 0.0, 1.0));
APoint argpt1(domsp, pt1, pt1);
APoint argpt2(domsp, pt1, pt2);
APoint argpt3(domsp, pt2, pt2);
APoint argpt4(domsp, pt1, pt3);
APoint argpt5(domsp, pt2, pt3);
APoint argpt6(domsp, pt3, pt3);
APoint xout;
xout = tstmp(argpt1);
truth((xout - aa).IsZeroVector(), TRUE);
xout = tstmp(argpt2);
truth((xout - ab).IsZeroVector(), TRUE);
xout = tstmp(argpt3);
truth((xout - bb).IsZeroVector(), TRUE);
xout = tstmp(argpt4);
truth((xout - ac).IsZeroVector(), TRUE);
xout = tstmp(argpt5);
truth((xout - bc).IsZeroVector(), TRUE);
xout = tstmp(argpt6);
truth((xout - cc).IsZeroVector(), TRUE);
// Test partial evaluation
GeObList part = GeObList(pt1, NullGeOb);
MAM mout = tstmp(part);
truth(mout.FullyEvaluated(), FALSE);
truth(mout.DomainSpace() == param, TRUE);
truth(mout.RangeSpace() == rng, TRUE);
mout = tstmp(param, part);
truth(mout.FullyEvaluated(), FALSE);
truth(mout.DomainSpace() == param, TRUE);
truth(mout.RangeSpace() == rng, TRUE);
xout = mout(pt2);
truth((xout - ab).IsZeroVector(), TRUE);
AVector tout = mout(GeObList(pt1 - pt2));
truth((tout - (aa - ab)).IsZeroVector(), TRUE);
// Test range space changes and acceptance of tangent vectors
VSpace tan = domsp.GetSpace(TANGENT);
VSpace rtan = rng.GetSpace(TANGENT);
AVector argvec1(tan, pt1 - pt2, pt1 - pt2);
GeOb gout1 = tstmp(argvec1);
truth(gout1.Holds() == AFF_VECTOR, TRUE);
mout = tstmp(GeObList((pt1 - pt2), NullGeOb));
truth(mout.FullyEvaluated(), FALSE);
truth(mout.DomainSpace() == param, TRUE);
truth(mout.RangeSpace() == rtan, TRUE);
GeOb gout2 = mout(GeObList(pt1 - pt2));
truth((gout2 - gout1).IsZeroVector(), TRUE);
}
// ***********************************************************************
// Test a cubic by quartic tensor product surface
//
void test2(void)
{
cout << "ENTERING TEST2\n";
beauty();
ASpace paramab("paramab", 1, TRUE);
Simplex smp1 = paramab.StdSimplex();
ASpace paramcd("paramcd", 1, TRUE);
Simplex smp2 = paramcd.StdSimplex();
ASpace rng("rngspace", 3, TRUE);
Frame fr2 = rng.StdBasis();
ASpace domsp("domsp",
SpaceList(paramab, paramab, paramab) + SpaceList(paramcd, paramcd), FALSE);
APoint sab1(smp1, ScalarList(0.3, 0.7));
APoint sab2(smp1, ScalarList(1.3, -0.3));
Simplex mysmpab("my simplexab", paramab, GeObList(sab1, sab2));
APoint scd1(smp2, ScalarList(0.2, 0.8));
APoint scd2(smp2, ScalarList(2.4, -1.4));
Simplex mysmpcd("my simplexcd", paramcd, GeObList(scd1, scd2));
IntList hold(2);
hold[0] = 3;
hold[1] = 2;
APoint aaa_cc(fr2, ScalarList(0.0, 0.0, 0.0, 1.0));
APoint aab_cc(fr2, ScalarList(1.0, 0.0, 0.3, 1.0));
APoint abb_cc(fr2, ScalarList(2.0, 0.0, 0.2, 1.0));
APoint bbb_cc(fr2, ScalarList(3.0, 0.0, 0.0, 1.0));
APoint aaa_cd(fr2, ScalarList(0.0, 1.0, 0.0, 1.0));
APoint aab_cd(fr2, ScalarList(1.0, 1.0, 0.8, 1.0));
APoint abb_cd(fr2, ScalarList(2.0, 1.0, 0.7, 1.0));
APoint bbb_cd(fr2, ScalarList(3.0, 1.0, 0.0, 1.0));
APoint aaa_dd(fr2, ScalarList(0.0, 2.0, 0.0, 1.0));
APoint aab_dd(fr2, ScalarList(1.0, 2.0, 0.6, 1.0));
APoint abb_dd(fr2, ScalarList(2.0, 2.0, 0.5, 1.0));
APoint bbb_dd(fr2, ScalarList(3.0, 2.0, 0.0, 1.0));
GeObList net = GeObList(aaa_cc, aaa_cd, aaa_dd) +
GeObList(aab_cc, aab_cd, aab_dd) +
GeObList(abb_cc, abb_cd, abb_dd) +
GeObList(bbb_cc, bbb_cd, bbb_dd);
MAM tstmp;
tstmp = MAM(domsp, hold, BasisList(mysmpab, mysmpcd), rng, net);
APoint a(mysmpab, ScalarList(1.0, 0.0));
APoint b(mysmpab, ScalarList(0.0, 1.0));
APoint c(mysmpcd, ScalarList(1.0, 0.0));
APoint d(mysmpcd, ScalarList(0.0, 1.0));
APoint pt1(domsp, GeObList(a, a, a) + GeObList(c, c));
APoint pt2(domsp, GeObList(a, a, b) + GeObList(c, c));
APoint pt3(domsp, GeObList(a, b, b) + GeObList(c, c));
APoint pt4(domsp, GeObList(b, b, b) + GeObList(c, c));
APoint pt5(domsp, GeObList(a, a, a) + GeObList(c, d));
APoint pt6(domsp, GeObList(a, a, b) + GeObList(c, d));
APoint pt7(domsp, GeObList(a, b, b) + GeObList(c, d));
APoint pt8(domsp, GeObList(b, b, b) + GeObList(c, d));
APoint pt9(domsp, GeObList(a, a, a) + GeObList(d, d));
APoint pt10(domsp, GeObList(a, a, b) + GeObList(d, d));
APoint pt11(domsp, GeObList(a, b, b) + GeObList(d, d));
APoint pt12(domsp, GeObList(b, b, b) + GeObList(d, d));
APoint xout;
xout = tstmp(pt1);
truth((xout - aaa_cc).IsZeroVector(), TRUE);
xout = tstmp(pt2);
truth((xout - aab_cc).IsZeroVector(), TRUE);
xout = tstmp(pt3);
truth((xout - abb_cc).IsZeroVector(), TRUE);
xout = tstmp(pt4);
truth((xout - bbb_cc).IsZeroVector(), TRUE);
xout = tstmp(pt5);
truth((xout - aaa_cd).IsZeroVector(), TRUE);
xout = tstmp(pt6);
truth((xout - aab_cd).IsZeroVector(), TRUE);
xout = tstmp(pt7);
truth((xout - abb_cd).IsZeroVector(), TRUE);
xout = tstmp(pt8);
truth((xout - bbb_cd).IsZeroVector(), TRUE);
xout = tstmp(pt9);
truth((xout - aaa_dd).IsZeroVector(), TRUE);
xout = tstmp(pt10);
truth((xout - aab_dd).IsZeroVector(), TRUE);
xout = tstmp(pt11);
truth((xout - abb_dd).IsZeroVector(), TRUE);
xout = tstmp(pt12);
truth((xout - bbb_dd).IsZeroVector(), TRUE);
// Test partial evaluation
GeObList part = GeObList(a, NullGeOb, a) + GeObList(d, NullGeOb);
ASpace inter("inter", SpaceList(paramab, paramcd), FALSE);
MAM mout = tstmp(inter, part);
truth(mout.FullyEvaluated(), FALSE);
truth(mout.DomainSpace() == inter, TRUE);
truth(mout.RangeSpace() == rng, TRUE);
part = GeObList(a, d);
xout = mout(part);
truth((xout - aaa_dd).IsZeroVector(), TRUE);
part = GeObList(a, d - c);
AVector tout = mout(part);
truth((tout - (aaa_dd - aaa_cd)).IsZeroVector(), TRUE);
// Test range space changes and acceptance of tangent vectors
VSpace tan = domsp.GetSpace(TANGENT);
VSpace rtan = rng.GetSpace(TANGENT);
AVector argvec1(tan, GeObList(a - b, a - b, a - b) +
GeObList(d - c, d - c));
GeOb tout1 = tstmp(argvec1);
truth(tout1.Holds() == AFF_VECTOR, TRUE);
}
// ***********************************************************************
// Test from 1 x 1 x 1 -> 3
void test3(void)
{
cout << "ENTERING TEST3\n";
beauty();
ASpace paramab("paramab", 1, TRUE);
Simplex smp1 = paramab.StdSimplex();
ASpace paramcd("paramcd", 1, TRUE);
Simplex smp2 = paramcd.StdSimplex();
ASpace paramef("paramef", 1, TRUE);
Simplex smp3 = paramef.StdSimplex();
ASpace rng("rngspace", 3, TRUE);
Frame fr2 = rng.StdBasis();
ASpace domsp("domsp", SpaceList(paramab, paramab, paramcd, paramcd) +
SpaceList(paramef, paramef), FALSE);
APoint sab1(smp1, ScalarList(0.3, 0.7));
APoint sab2(smp1, ScalarList(1.3, -0.3));
Simplex mysmpab("my simplexab", paramab, GeObList(sab1, sab2));
APoint scd1(smp2, ScalarList(0.2, 0.8));
APoint scd2(smp2, ScalarList(2.4, -1.4));
Simplex mysmpcd("my simplexcd", paramcd, GeObList(scd1, scd2));
APoint sef1(smp3, ScalarList(0.1, 0.9));
APoint sef2(smp3, ScalarList(1.2, -0.2));
Simplex mysmpef("my simplexef", paramef, GeObList(sef1, sef2));
IntList hold(2, 2, 2);
APoint aa_cc_ee(fr2, ScalarList(0.0, 0.0, 0.0, 1.0));
APoint ab_cc_ee(fr2, ScalarList(1.0, 0.0, 0.3, 1.0));
APoint bb_cc_ee(fr2, ScalarList(2.0, 0.0, 0.0, 1.0));
APoint aa_cd_ee(fr2, ScalarList(0.0, 1.0, 0.3, 1.0));
APoint ab_cd_ee(fr2, ScalarList(1.0, 1.0, 0.6, 1.0));
APoint bb_cd_ee(fr2, ScalarList(2.0, 1.0, 0.3, 1.0));
APoint aa_dd_ee(fr2, ScalarList(0.0, 2.0, 0.0, 1.0));
APoint ab_dd_ee(fr2, ScalarList(1.0, 2.0, 0.3, 1.0));
APoint bb_dd_ee(fr2, ScalarList(2.0, 2.0, 0.0, 1.0));
APoint aa_cc_ef(fr2, ScalarList(0.0, 0.0, 1.0, 1.0));
APoint ab_cc_ef(fr2, ScalarList(1.0, 0.0, 1.3, 1.0));
APoint bb_cc_ef(fr2, ScalarList(2.0, 0.0, 1.0, 1.0));
APoint aa_cd_ef(fr2, ScalarList(0.0, 1.0, 1.3, 1.0));
APoint ab_cd_ef(fr2, ScalarList(1.0, 1.0, 1.6, 1.0));
APoint bb_cd_ef(fr2, ScalarList(2.0, 1.0, 1.3, 1.0));
APoint aa_dd_ef(fr2, ScalarList(0.0, 2.0, 1.0, 1.0));
APoint ab_dd_ef(fr2, ScalarList(1.0, 2.0, 1.3, 1.0));
APoint bb_dd_ef(fr2, ScalarList(2.0, 2.0, 1.0, 1.0));
APoint aa_cc_ff(fr2, ScalarList(0.0, 0.0, 2.0, 1.0));
APoint ab_cc_ff(fr2, ScalarList(1.0, 0.0, 2.3, 1.0));
APoint bb_cc_ff(fr2, ScalarList(2.0, 0.0, 2.0, 1.0));
APoint aa_cd_ff(fr2, ScalarList(0.0, 1.0, 2.3, 1.0));
APoint ab_cd_ff(fr2, ScalarList(1.0, 1.0, 2.6, 1.0));
APoint bb_cd_ff(fr2, ScalarList(2.0, 1.0, 2.3, 1.0));
APoint aa_dd_ff(fr2, ScalarList(0.0, 2.0, 2.0, 1.0));
APoint ab_dd_ff(fr2, ScalarList(1.0, 2.0, 2.3, 1.0));
APoint bb_dd_ff(fr2, ScalarList(2.0, 2.0, 2.0, 1.0));
GeObList net = GeObList(aa_cc_ee, aa_cc_ef, aa_cc_ff) +
GeObList(aa_cd_ee, aa_cd_ef, aa_cd_ff) +
GeObList(aa_dd_ee, aa_dd_ef, aa_dd_ff) +
GeObList(ab_cc_ee, ab_cc_ef, ab_cc_ff) +
GeObList(ab_cd_ee, ab_cd_ef, ab_cd_ff) +
GeObList(ab_dd_ee, ab_dd_ef, ab_dd_ff) +
GeObList(bb_cc_ee, bb_cc_ef, bb_cc_ff) +
GeObList(bb_cd_ee, bb_cd_ef, bb_cd_ff) +
GeObList(bb_dd_ee, bb_dd_ef, bb_dd_ff);
MAM tstmp;
tstmp = MAM(domsp, hold, BasisList(mysmpab, mysmpcd, mysmpef), rng, net);
APoint a(mysmpab, ScalarList(1.0, 0.0));
APoint b(mysmpab, ScalarList(0.0, 1.0));
APoint c(mysmpcd, ScalarList(1.0, 0.0));
APoint d(mysmpcd, ScalarList(0.0, 1.0));
APoint e(mysmpef, ScalarList(1.0, 0.0));
APoint f(mysmpef, ScalarList(0.0, 1.0));
APoint pt1(domsp, GeObList(a, a) + GeObList(c, c) + GeObList(e, e));
APoint pt2(domsp, GeObList(a, b) + GeObList(c, c) + GeObList(e, e));
APoint pt3(domsp, GeObList(b, b) + GeObList(c, c) + GeObList(e, e));
APoint pt4(domsp, GeObList(a, a) + GeObList(c, d) + GeObList(e, e));
APoint pt5(domsp, GeObList(a, b) + GeObList(c, d) + GeObList(e, e));
APoint pt6(domsp, GeObList(b, b) + GeObList(c, d) + GeObList(e, e));
APoint pt7(domsp, GeObList(a, a) + GeObList(d, d) + GeObList(e, e));
APoint pt8(domsp, GeObList(a, b) + GeObList(d, d) + GeObList(e, e));
APoint pt9(domsp, GeObList(b, b) + GeObList(d, d) + GeObList(e, e));
APoint pt10(domsp, GeObList(a, a) + GeObList(c, c) + GeObList(e, f));
APoint pt11(domsp, GeObList(a, b) + GeObList(c, c) + GeObList(e, f));
APoint pt12(domsp, GeObList(b, b) + GeObList(c, c) + GeObList(e, f));
APoint pt13(domsp, GeObList(a, a) + GeObList(c, d) + GeObList(e, f));
APoint pt14(domsp, GeObList(a, b) + GeObList(c, d) + GeObList(e, f));
APoint pt15(domsp, GeObList(b, b) + GeObList(c, d) + GeObList(e, f));
APoint pt16(domsp, GeObList(a, a) + GeObList(d, d) + GeObList(e, f));
APoint pt17(domsp, GeObList(a, b) + GeObList(d, d) + GeObList(e, f));
APoint pt18(domsp, GeObList(b, b) + GeObList(d, d) + GeObList(e, f));
APoint pt19(domsp, GeObList(a, a) + GeObList(c, c) + GeObList(f, f));
APoint pt20(domsp, GeObList(a, b) + GeObList(c, c) + GeObList(f, f));
APoint pt21(domsp, GeObList(b, b) + GeObList(c, c) + GeObList(f, f));
APoint pt22(domsp, GeObList(a, a) + GeObList(c, d) + GeObList(f, f));
APoint pt23(domsp, GeObList(a, b) + GeObList(c, d) + GeObList(f, f));
APoint pt24(domsp, GeObList(b, b) + GeObList(c, d) + GeObList(f, f));
APoint pt25(domsp, GeObList(a, a) + GeObList(d, d) + GeObList(f, f));
APoint pt26(domsp, GeObList(a, b) + GeObList(d, d) + GeObList(f, f));
APoint pt27(domsp, GeObList(b, b) + GeObList(d, d) + GeObList(f, f));
APoint xout;
xout = tstmp(pt1);
truth((xout - aa_cc_ee).IsZeroVector(), TRUE);
xout = tstmp(pt2);
truth((xout - ab_cc_ee).IsZeroVector(), TRUE);
xout = tstmp(pt3);
truth((xout - bb_cc_ee).IsZeroVector(), TRUE);
xout = tstmp(pt4);
truth((xout - aa_cd_ee).IsZeroVector(), TRUE);
xout = tstmp(pt5);
truth((xout - ab_cd_ee).IsZeroVector(), TRUE);
xout = tstmp(pt6);
truth((xout - bb_cd_ee).IsZeroVector(), TRUE);
xout = tstmp(pt7);
truth((xout - aa_dd_ee).IsZeroVector(), TRUE);
xout = tstmp(pt8);
truth((xout - ab_dd_ee).IsZeroVector(), TRUE);
xout = tstmp(pt9);
truth((xout - bb_dd_ee).IsZeroVector(), TRUE);
xout = tstmp(pt10);
truth((xout - aa_cc_ef).IsZeroVector(), TRUE);
xout = tstmp(pt11);
truth((xout - ab_cc_ef).IsZeroVector(), TRUE);
xout = tstmp(pt12);
truth((xout - bb_cc_ef).IsZeroVector(), TRUE);
xout = tstmp(pt13);
truth((xout - aa_cd_ef).IsZeroVector(), TRUE);
xout = tstmp(pt14);
truth((xout - ab_cd_ef).IsZeroVector(), TRUE);
xout = tstmp(pt15);
truth((xout - bb_cd_ef).IsZeroVector(), TRUE);
xout = tstmp(pt16);
truth((xout - aa_dd_ef).IsZeroVector(), TRUE);
xout = tstmp(pt17);
truth((xout - ab_dd_ef).IsZeroVector(), TRUE);
xout = tstmp(pt18);
truth((xout - bb_dd_ef).IsZeroVector(), TRUE);
xout = tstmp(pt19);
truth((xout - aa_cc_ff).IsZeroVector(), TRUE);
xout = tstmp(pt20);
truth((xout - ab_cc_ff).IsZeroVector(), TRUE);
xout = tstmp(pt21);
truth((xout - bb_cc_ff).IsZeroVector(), TRUE);
xout = tstmp(pt22);
truth((xout - aa_cd_ff).IsZeroVector(), TRUE);
xout = tstmp(pt23);
truth((xout - ab_cd_ff).IsZeroVector(), TRUE);
xout = tstmp(pt24);
truth((xout - bb_cd_ff).IsZeroVector(), TRUE);
xout = tstmp(pt25);
truth((xout - aa_dd_ff).IsZeroVector(), TRUE);
xout = tstmp(pt26);
truth((xout - ab_dd_ff).IsZeroVector(), TRUE);
xout = tstmp(pt27);
truth((xout - bb_dd_ff).IsZeroVector(), TRUE);
}
// ***********************************************************************
// Test from 1 x 2 -> 3
void test4(void)
{
cout << "ENTERING TEST4\n";
beauty();
ASpace paramef("paramef", 1, TRUE);
Simplex smp1 = paramef.StdSimplex();
ASpace param2("param2", 2, TRUE);
Simplex smp2 = param2.StdSimplex();
APoint sef1(smp1, ScalarList(0.3, 0.7));
APoint sef2(smp1, ScalarList(1.3, -0.3));
Simplex mysmpef("my simplexab", paramef, GeObList(sef1, sef2));
APoint s1(smp2, ScalarList(0.4, 0.3, 0.3));
APoint s2(smp2, ScalarList(1.5, 2.0, -2.5));
APoint s3(smp2, ScalarList(0.9, -0.3, 0.4));
Simplex mysimp("my simplex2", param2, GeObList(s1, s2, s3));
ASpace rng("rngspace", 3, TRUE);
Frame fr2 = rng.StdBasis();
ASpace domsp("domsp", SpaceList(param2, param2, paramef, paramef), FALSE);
IntList hold(2);
hold[0] = 2;
hold[1] = 2;
APoint aa_ee(fr2, ScalarList(0.0, 0.0, 0.0, 1.0));
APoint ab_ee(fr2, ScalarList(1.0, 0.0, 0.3, 1.0));
APoint bb_ee(fr2, ScalarList(2.0, 0.0, 0.0, 1.0));
APoint ac_ee(fr2, ScalarList(0.5, 1.0, 0.3, 1.0));
APoint bc_ee(fr2, ScalarList(1.5, 1.0, 0.3, 1.0));
APoint cc_ee(fr2, ScalarList(1.0, 2.0, 0.0, 1.0));
APoint aa_ef(fr2, ScalarList(0.0, 0.0, 1.0, 1.0));
APoint ab_ef(fr2, ScalarList(1.0, 0.0, 1.3, 1.0));
APoint bb_ef(fr2, ScalarList(2.0, 0.0, 1.0, 1.0));
APoint ac_ef(fr2, ScalarList(0.5, 1.0, 1.3, 1.0));
APoint bc_ef(fr2, ScalarList(1.5, 1.0, 1.3, 1.0));
APoint cc_ef(fr2, ScalarList(1.0, 2.0, 1.0, 1.0));
APoint aa_ff(fr2, ScalarList(0.0, 0.0, 2.0, 1.0));
APoint ab_ff(fr2, ScalarList(1.0, 0.0, 2.3, 1.0));
APoint bb_ff(fr2, ScalarList(2.0, 0.0, 2.0, 1.0));
APoint ac_ff(fr2, ScalarList(0.5, 1.0, 2.3, 1.0));
APoint bc_ff(fr2, ScalarList(1.5, 1.0, 2.3, 1.0));
APoint cc_ff(fr2, ScalarList(1.0, 2.0, 2.0, 1.0));
GeObList net = GeObList(aa_ee, aa_ef, aa_ff) +
GeObList(ab_ee, ab_ef, ab_ff) +
GeObList(bb_ee, bb_ef, bb_ff) +
GeObList(ac_ee, ac_ef, ac_ff) +
GeObList(bc_ee, bc_ef, bc_ff) +
GeObList(cc_ee, cc_ef, cc_ff);
MAM tstmp;
tstmp = MAM(domsp, hold, BasisList(mysimp, mysmpef), rng, net);
APoint a(mysimp, ScalarList(1.0, 0.0, 0.0));
APoint b(mysimp, ScalarList(0.0, 1.0, 0.0));
APoint c(mysimp, ScalarList(0.0, 0.0, 1.0));
APoint e(mysmpef, ScalarList(1.0, 0.0));
APoint f(mysmpef, ScalarList(0.0, 1.0));
APoint pt1(domsp, GeObList(a, a, e, e));
APoint pt2(domsp, GeObList(a, b, e, e));
APoint pt3(domsp, GeObList(b, b, e, e));
APoint pt4(domsp, GeObList(a, c, e, e));
APoint pt5(domsp, GeObList(b, c, e, e));
APoint pt6(domsp, GeObList(c, c, e, e));
APoint pt7(domsp, GeObList(a, a, e, f));
APoint pt8(domsp, GeObList(a, b, e, f));
APoint pt9(domsp, GeObList(b, b, e, f));
APoint pt10(domsp, GeObList(a, c, e, f));
APoint pt11(domsp, GeObList(b, c, e, f));
APoint pt12(domsp, GeObList(c, c, e, f));
APoint pt13(domsp, GeObList(a, a, f, f));
APoint pt14(domsp, GeObList(a, b, f, f));
APoint pt15(domsp, GeObList(b, b, f, f));
APoint pt16(domsp, GeObList(a, c, f, f));
APoint pt17(domsp, GeObList(b, c, f, f));
APoint pt18(domsp, GeObList(c, c, f, f));
APoint xout;
xout = tstmp(pt1);
truth((xout - aa_ee).IsZeroVector(), TRUE);
xout = tstmp(pt2);
truth((xout - ab_ee).IsZeroVector(), TRUE);
xout = tstmp(pt3);
truth((xout - bb_ee).IsZeroVector(), TRUE);
xout = tstmp(pt4);
truth((xout - ac_ee).IsZeroVector(), TRUE);
xout = tstmp(pt5);
truth((xout - bc_ee).IsZeroVector(), TRUE);
xout = tstmp(pt6);
truth((xout - cc_ee).IsZeroVector(), TRUE);
xout = tstmp(pt7);
truth((xout - aa_ef).IsZeroVector(), TRUE);
xout = tstmp(pt8);
truth((xout - ab_ef).IsZeroVector(), TRUE);
xout = tstmp(pt9);
truth((xout - bb_ef).IsZeroVector(), TRUE);
xout = tstmp(pt10);
truth((xout - ac_ef).IsZeroVector(), TRUE);
xout = tstmp(pt11);
truth((xout - bc_ef).IsZeroVector(), TRUE);
xout = tstmp(pt12);
truth((xout - cc_ef).IsZeroVector(), TRUE);
xout = tstmp(pt13);
truth((xout - aa_ff).IsZeroVector(), TRUE);
xout = tstmp(pt14);
truth((xout - ab_ff).IsZeroVector(), TRUE);
xout = tstmp(pt15);
truth((xout - bb_ff).IsZeroVector(), TRUE);
xout = tstmp(pt16);
truth((xout - ac_ff).IsZeroVector(), TRUE);
xout = tstmp(pt17);
truth((xout - bc_ff).IsZeroVector(), TRUE);
xout = tstmp(pt18);
truth((xout - cc_ff).IsZeroVector(), TRUE);
}
// ***********************************************************************
// Test from 3 -> 3
void test5(void)
{
cout << "ENTERING TEST5\n";
beauty();
ASpace param("paramspace", 3, TRUE);
Simplex smp1 = param.StdSimplex();
APoint s1(smp1, ScalarList(0.2, 0.3, 0.3, 0.2));
APoint s2(smp1, ScalarList(1.0, 2.0, -2.5, 0.5));
APoint s3(smp1, ScalarList(0.6, -0.3, 0.4, 0.3));
APoint s4(smp1, ScalarList(1.7, -0.9, 0.1, 0.1));
Simplex mysimp("my simplex", param, GeObList(s1, s2, s3, s4));
ASpace rng("rngspace", 3, TRUE);
Frame fr2 = rng.StdBasis();
ASpace domsp("testdom", SpaceList(param, 2), FALSE);
IntList hold(1);
hold[0] = 2;
APoint aa(fr2, ScalarList(0.0, 0.0, 0.0, 1.0));
APoint ab(fr2, ScalarList(1.0, 0.0, 0.0, 1.0));
APoint bb(fr2, ScalarList(2.0, 0.0, 0.0, 1.0));
APoint ac(fr2, ScalarList(0.5, 1.0, 0.0, 1.0));
APoint bc(fr2, ScalarList(1.5, 1.0, 0.0, 1.0));
APoint cc(fr2, ScalarList(1.0, 2.0, 0.0, 1.0));
APoint da(fr2, ScalarList(0.5, 0.5, 1.0, 1.0));
APoint db(fr2, ScalarList(1.5, 0.5, 1.0, 1.0));
APoint dc(fr2, ScalarList(2.5, 0.5, 1.0, 1.0));
APoint dd(fr2, ScalarList(1.0, 1.0, 2.0, 1.0));
GeObList net = GeObList(aa, ab, bb) +
GeObList(ac, bc, cc) +
GeObList(da, db, dc, dd);
MAM tstmp(domsp, hold, BasisList(mysimp), rng, net);
APoint pt1(mysimp, ScalarList(1.0, 0.0, 0.0, 0.0));
APoint pt2(mysimp, ScalarList(0.0, 1.0, 0.0, 0.0));
APoint pt3(mysimp, ScalarList(0.0, 0.0, 1.0, 0.0));
APoint pt4(mysimp, ScalarList(0.0, 0.0, 0.0, 1.0));
APoint apt1(domsp, pt1, pt1);
APoint apt2(domsp, pt1, pt2);
APoint apt3(domsp, pt2, pt2);
APoint apt4(domsp, pt1, pt3);
APoint apt5(domsp, pt2, pt3);
APoint apt6(domsp, pt3, pt3);
APoint apt7(domsp, pt4, pt1);
APoint apt8(domsp, pt4, pt2);
APoint apt9(domsp, pt4, pt3);
APoint apt10(domsp, pt4, pt4);
APoint xout;
xout = tstmp(apt1);
truth((xout - aa).IsZeroVector(), TRUE);
xout = tstmp(apt2);
truth((xout - ab).IsZeroVector(), TRUE);
xout = tstmp(apt3);
truth((xout - bb).IsZeroVector(), TRUE);
xout = tstmp(apt4);
truth((xout - ac).IsZeroVector(), TRUE);
xout = tstmp(apt5);
truth((xout - bc).IsZeroVector(), TRUE);
xout = tstmp(apt6);
truth((xout - cc).IsZeroVector(), TRUE);
xout = tstmp(apt7);
truth((xout - da).IsZeroVector(), TRUE);
xout = tstmp(apt8);
truth((xout - db).IsZeroVector(), TRUE);
xout = tstmp(apt9);
truth((xout - dc).IsZeroVector(), TRUE);
xout = tstmp(apt10);
truth((xout - dd).IsZeroVector(), TRUE);
}
// ***********************************************************************
// General linear map
void test6(void)
{
cout << "ENTERING TEST6\n";
beauty();
VSpace param("param", 2, TRUE);
VBasis vba1 = param.StdBasis();
VSpace rng("rngspace", 3, TRUE);
VBasis vba2 = rng.StdBasis();
VSpace domsp("domsp", SpaceList(param, param, param), FALSE);
Vector b1(vba1, ScalarList(0.3, 1.4));
Vector b2(vba1, ScalarList(2.1, 3.2));
VBasis myvba("my basis", param, GeObList(b1, b2));
IntList hold(1, 1, 1);
Vector aaa(vba2, ScalarList(0.0, 0.0, 0.0));
Vector aab(vba2, ScalarList(0.0, 2.0, 0.0));
Vector aba(vba2, ScalarList(2.0, 0.0, 0.0));
Vector abb(vba2, ScalarList(2.0, 2.0, 0.0));
Vector baa(vba2, ScalarList(0.0, 0.0, 1.0));
Vector bab(vba2, ScalarList(0.0, 1.0, 1.0));
Vector bba(vba2, ScalarList(1.0, 0.0, 1.0));
Vector bbb(vba2, ScalarList(1.0, 1.0, 1.0));
GeObList net = GeObList(aaa, aab, aba, abb) + GeObList(baa, bab, bba, bbb);
MLM tstmp;
tstmp = MLM(domsp, hold, BasisList(myvba, myvba, myvba), rng, net);
Vector a(myvba, ScalarList(1.0, 0.0));
Vector b(myvba, ScalarList(0.0, 1.0));
Vector v1(domsp, GeObList(a, a, a));
Vector v2(domsp, GeObList(a, a, b));
Vector v3(domsp, GeObList(a, b, a));
Vector v4(domsp, GeObList(a, b, b));
Vector v5(domsp, GeObList(b, a, a));
Vector v6(domsp, GeObList(b, a, b));
Vector v7(domsp, GeObList(b, b, a));
Vector v8(domsp, GeObList(b, b, b));
Vector xout;
xout = tstmp(v1);
truth((xout - aaa).IsZeroVector(), TRUE);
xout = tstmp(v2);
truth((xout - aab).IsZeroVector(), TRUE);
xout = tstmp(v3);
truth((xout - aba).IsZeroVector(), TRUE);
xout = tstmp(v4);
truth((xout - abb).IsZeroVector(), TRUE);
xout = tstmp(v5);
truth((xout - baa).IsZeroVector(), TRUE);
xout = tstmp(v6);
truth((xout - bab).IsZeroVector(), TRUE);
xout = tstmp(v7);
truth((xout - bba).IsZeroVector(), TRUE);
xout = tstmp(v8);
truth((xout - bbb).IsZeroVector(), TRUE);
}
// ***********************************************************************
// Antisymmetric MLM:
void test7(void)
{
// Define a MLM on a 4-d space that takes 3 arguments
cout << "ENTERING TEST7\n";
beauty();
VSpace param("param", 4, TRUE);
VBasis vba1 = param.StdBasis();
VSpace rng("rngspace", 4, TRUE);
VBasis vba2 = rng.StdBasis();
VSpace domsp("domsp", SpaceList(param, param, param), FALSE);
Vector b1(vba1, ScalarList(0.3, 1.4, 2.3, 4.5));
Vector b2(vba1, ScalarList(2.1, 3.2, 1.1, 7.6));
Vector b3(vba1, ScalarList(6.7, -3.4, -2.5, 9.7));
Vector b4(vba1, ScalarList(-5.2, 8.5, 1.1, 3.4));
VBasis myvba("my basis", param, GeObList(b1, b2, b3, b4));
IntList hold(1);
hold[0] = -3;
Vector abc(vba2, ScalarList(1.0, 0.0, 0.0, 0.0));
Vector abd(vba2, ScalarList(0.0, 2.0, 0.0, 2.0));
Vector acd(vba2, ScalarList(2.0, 0.0, 2.0, 0.0));
Vector bcd(vba2, ScalarList(2.0, 2.0, 0.0, 0.0));
GeObList net = GeObList(abc, abd, acd, bcd);
MLM tstmp;
tstmp = MLM(domsp, hold, BasisList(myvba), rng, net);
Vector a(myvba, ScalarList(1.0, 0.0, 0.0, 0.0));
Vector b(myvba, ScalarList(0.0, 1.0, 0.0, 0.0));
Vector c(myvba, ScalarList(0.0, 0.0, 1.0, 0.0));
Vector d(myvba, ScalarList(0.0, 0.0, 0.0, 1.0));
Vector v1(domsp, GeObList(a, b, c));
Vector v2(domsp, GeObList(a, b, d));
Vector v3(domsp, GeObList(a, c, d));
Vector v4(domsp, GeObList(b, c, d));
Vector v5(domsp, GeObList(b, a, c));
Vector v6(domsp, GeObList(d, b, a));
Vector v7(domsp, GeObList(a, d, c));
Vector v8(domsp, GeObList(d, b, c));
Vector xout;
xout = tstmp(v1);
truth((xout - abc).IsZeroVector(), TRUE);
xout = tstmp(v2);
truth((xout - abd).IsZeroVector(), TRUE);
xout = tstmp(v3);
truth((xout - acd).IsZeroVector(), TRUE);
xout = tstmp(v4);
truth((xout - bcd).IsZeroVector(), TRUE);
xout = tstmp(v5);
truth((xout + abc).IsZeroVector(), TRUE);
xout = tstmp(v6);
truth((xout + abd).IsZeroVector(), TRUE);
xout = tstmp(v7);
truth((xout + acd).IsZeroVector(), TRUE);
xout = tstmp(v8);
truth((xout - bcd).IsZeroVector(), TRUE);
}
// ***********************************************************************
// Antisymmetric MLM:
void test8(void)
{
// Define a MLM on a 4-d space that takes 2 arguments
cout << "ENTERING TEST8\n";
beauty();
VSpace param("param", 4, TRUE);
VBasis vba1 = param.StdBasis();
VSpace rng("rngspace", 4, TRUE);
VBasis vba2 = rng.StdBasis();
VSpace domsp("domsp", SpaceList(param, param), FALSE);
Vector b1(vba1, ScalarList(0.3, 1.4, 2.3, 4.5));
Vector b2(vba1, ScalarList(2.1, 3.2, 1.1, 7.6));
Vector b3(vba1, ScalarList(6.7, -3.4, -2.5, 9.7));
Vector b4(vba1, ScalarList(-5.2, 8.5, 1.1, 3.4));
VBasis myvba("my basis", param, GeObList(b1, b2, b3, b4));
IntList hold(1);
hold[0] = -2;
Vector ab(vba2, ScalarList(1.0, 0.0, 0.0, 0.0));
Vector ac(vba2, ScalarList(0.0, 2.0, 0.0, 5.0));
Vector bc(vba2, ScalarList(2.0, 0.0, 7.0, 0.0));
Vector ad(vba2, ScalarList(2.0, 3.0, 0.0, 0.0));
Vector bd(vba2, ScalarList(5.0, 0.0, 1.0, 0.0));
Vector cd(vba2, ScalarList(8.0, 2.0, 4.0, 3.0));
GeObList net = GeObList(ab, ac, bc) + GeObList(ad, bd, cd);
MLM tstmp;
tstmp = MLM(domsp, hold, BasisList(myvba), rng, net);
Vector a(myvba, ScalarList(1.0, 0.0, 0.0, 0.0));
Vector b(myvba, ScalarList(0.0, 1.0, 0.0, 0.0));
Vector c(myvba, ScalarList(0.0, 0.0, 1.0, 0.0));
Vector d(myvba, ScalarList(0.0, 0.0, 0.0, 1.0));
Vector v1(domsp, GeObList(a, b));
Vector v2(domsp, GeObList(a, c));
Vector v3(domsp, GeObList(b, c));
Vector v4(domsp, GeObList(a, d));
Vector v5(domsp, GeObList(b, d));
Vector v6(domsp, GeObList(c, d));
Vector v7(domsp, GeObList(b, a));
Vector v8(domsp, GeObList(c, b));
Vector v9(domsp, GeObList(d, b));
Vector v10(domsp, GeObList(d, a));
Vector xout;
xout = tstmp(v1);
truth((xout - ab).IsZeroVector(), TRUE);
xout = tstmp(v2);
truth((xout - ac).IsZeroVector(), TRUE);
xout = tstmp(v3);
truth((xout - bc).IsZeroVector(), TRUE);
xout = tstmp(v4);
truth((xout - ad).IsZeroVector(), TRUE);
xout = tstmp(v5);
truth((xout - bd).IsZeroVector(), TRUE);
xout = tstmp(v6);
truth((xout - cd).IsZeroVector(), TRUE);
xout = tstmp(v7);
truth((xout + ab).IsZeroVector(), TRUE);
xout = tstmp(v8);
truth((xout + bc).IsZeroVector(), TRUE);
xout = tstmp(v9);
truth((xout + bd).IsZeroVector(), TRUE);
xout = tstmp(v10);
truth((xout + ad).IsZeroVector(), TRUE);
}
// ***********************************************************************
// Create Multimap from a geob
// a vector -> map from dual to real -> mlm
void test9(void)
{
cout << "ENTERING TEST9\n";
beauty();
VSpace v1("v1space", 4, TRUE);
VBasis bas1 = v1.StdBasis();
Vector foo(bas1, ScalarList(7.2, 3.4, 12.1, 6.7));
Vector bar(bas1, ScalarList(12.3, 4.1, 3.6, 3.2));
Vector bard = bar.Dual();
MLM foomap(foo);
Scalar res1 = foo.Apply(bard);
Scalar res = foomap(bard).ToScalar();
cout << "res1: " << res1 << "\n";
cout << "res: " << res << "\n";
MLM part = foomap(GeObList(bard));
truth((part.RangeSpace() == Reals), TRUE);
truth(part.FullyEvaluated(), TRUE);
Scalar res2 = part.ToScalar();
cout << "res2: " << res2 << "\n";
}
// ***********************************************************************
// Create Multimap from a map
//
// affine -> vector
// affine -> affine
// vector -> vector
//
void test10(void)
{
cout << "ENTERING TEST10\n";
beauty();
VSpace vs1("vs1", 3, TRUE);
VSpace vs2("vs2", 3, TRUE);
ASpace as1("as1", 2, TRUE);
ASpace as2("as2", 2, TRUE);
// Create an affine map:
Frame fra1 = as1.StdBasis();
Frame fra2 = as2.StdBasis();
APoint a1(fra1, ScalarList(3.6, -4.5, 1.0));
APoint a2(fra1, ScalarList(2.2, 5.1, 1.0));
APoint a3(fra1, ScalarList(-6.7, 2.3, 1.0));
APoint a4(fra1, ScalarList(-1.4, -7.9, 1.0));
Simplex s1("test simplex", as1, GeObList(a1, a2, a3));
Simplex std = as2.StdSimplex();
AffineMap am1(s1, std);
MAM mam1(am1);
GeOb xout;
GeOb comp;
xout = am1(a1);
comp = mam1(a1);
truth(comp.Holds() == AFF_POINT, TRUE);
truth((xout - comp).IsZeroVector(), TRUE);
xout = am1(a2);
comp = mam1(a2);
truth((xout - comp).IsZeroVector(), TRUE);
xout = am1(a3);
comp = mam1(a3);
truth((xout - comp).IsZeroVector(), TRUE);
xout = am1(a4);
comp = mam1(a4);
truth((xout - comp).IsZeroVector(), TRUE);
xout = am1(a4 - a3);
comp = mam1(a4 - a3);
truth(comp.Holds() == AFF_VECTOR, TRUE);
truth((xout - comp).IsZeroVector(), TRUE);
// Create a linear map:
VBasis bas1 = vs1.StdBasis();
VBasis bas2 = vs2.StdBasis();
Vector v1(bas1, ScalarList(3.6, 4.5, -2.3));
Vector v2(bas1, ScalarList(2.2, -1.5, -1.4));
Vector v3(bas1, ScalarList(-7.6, 2.3, 3.5));
Vector v4(bas1, ScalarList(-1.4, -7.9, 8.9));
VBasis b1("test basis", vs1, GeObList(v1, v2, v3));
LinearMap lm1(b1, bas2);
MLM mlm1(lm1);
xout = lm1(v1);
comp = mlm1(v1);
truth(comp.Holds() == VECTOR, TRUE);
truth((xout - comp).IsZeroVector(), TRUE);
xout = lm1(v2);
comp = mlm1(v2);
truth((xout - comp).IsZeroVector(), TRUE);
xout = lm1(v3);
comp = mlm1(v3);
truth((xout - comp).IsZeroVector(), TRUE);
xout = lm1(v4);
comp = mlm1(v4);
truth((xout - comp).IsZeroVector(), TRUE);
// Create affine maps to vector space:
VSubSet vsub1("2dvec", vs1, GeObList(v1, v2));
AffineMap am2(s1, vsub1, GeObList(v1, v2, v1 + v2));
ASubSet asub1("2daff", vs1, GeObList(v1, v2, v3));
AffineMap am3(s1, asub1, GeObList(v1, v2, v3));
MAM mam2(am2);
xout = am2(a1);
comp = mam2(a1);
truth(comp.Holds() == VECTOR, TRUE);
truth((xout - comp).IsZeroVector(), TRUE);
xout = am2(a2);
comp = mam2(a2);
truth((xout - comp).IsZeroVector(), TRUE);
xout = am2(a3);
comp = mam2(a3);
truth((xout - comp).IsZeroVector(), TRUE);
xout = am2(a4);
comp = mam2(a4);
truth((xout - comp).IsZeroVector(), TRUE);
xout = am2(a4 - a3);
comp = mam2(a4 - a3);
truth(comp.Holds() == VECTOR, TRUE);
truth((xout - comp).IsZeroVector(), TRUE);
MAM mam3(am3);
xout = am3(a1);
comp = mam3(a1);
truth(comp.Holds() == VECTOR, TRUE);
truth((xout - comp).IsZeroVector(), TRUE);
xout = am3(a2);
comp = mam3(a2);
truth((xout - comp).IsZeroVector(), TRUE);
xout = am3(a3);
comp = mam3(a3);
truth((xout - comp).IsZeroVector(), TRUE);
xout = am3(a4);
comp = mam3(a4);
truth((xout - comp).IsZeroVector(), TRUE);
xout = am3(a4 - a3);
comp = mam3(a4 - a3);
truth(comp.Holds() == VECTOR, TRUE);
truth((xout - comp).IsZeroVector(), TRUE);
}
// ***********************************************************************
// Test more range changes and partial evaluation
void test11(void)
{
cout << "ENTERING TEST11\n";
beauty();
ASpace param("paramspace", 1, TRUE);
Simplex smp1 = param.StdSimplex();
APoint s1(smp1, ScalarList(0.2, 0.8));
APoint s2(smp1, ScalarList(0.5, 0.5));
Simplex mysimp("my simplex", param, GeObList(s1, s2));
ASpace rng("rngspace", 2, TRUE);
Frame fr2 = rng.StdBasis();
ASpace domsp("testdom", SpaceList(param, 4), FALSE);
IntList hold(1);
hold[0] = 4;
APoint aaaa(fr2, ScalarList(0.0, 0.0, 1.0));
APoint aaab(fr2, ScalarList(1.0, 1.0, 1.0));
APoint aabb(fr2, ScalarList(1.5, 1.5, 1.0));
APoint abbb(fr2, ScalarList(2.0, 0.7, 1.0));
APoint bbbb(fr2, ScalarList(2.5, 1.0, 1.0));
GeObList net = GeObList(aaaa, aaab, aabb) + GeObList(abbb, bbbb);
MAM tstmp(domsp, hold, BasisList(mysimp), rng, net);
APoint pt1(mysimp, ScalarList(1.0, 0.0));
APoint pt2(mysimp, ScalarList(0.0, 1.0));
APoint apt1(domsp, GeObList(pt1, pt1, pt1, pt1));
APoint apt2(domsp, GeObList(pt1, pt1, pt1, pt2));
APoint apt3(domsp, GeObList(pt1, pt1, pt2, pt2));
APoint apt4(domsp, GeObList(pt1, pt2, pt2, pt2));
APoint apt5(domsp, GeObList(pt2, pt2, pt2, pt2));
APoint xout;
xout = tstmp(apt1);
truth((xout - aaaa).IsZeroVector(), TRUE);
xout = tstmp(apt2);
truth((xout - aaab).IsZeroVector(), TRUE);
xout = tstmp(apt3);
truth((xout - aabb).IsZeroVector(), TRUE);
xout = tstmp(apt4);
truth((xout - abbb).IsZeroVector(), TRUE);
xout = tstmp(apt5);
truth((xout - bbbb).IsZeroVector(), TRUE);
// Test partial evaluation
GeObList part = GeObList(pt1, NullGeOb, NullGeOb, pt2 - pt1);
ASpace inter("inter", SpaceList(param, 2), FALSE);
VSpace newrng = rng.GetSpace(TANGENT);
MAM mout = tstmp(inter, part);
truth(mout.FullyEvaluated(), FALSE);
truth(mout.DomainSpace() == inter, TRUE);
truth(mout.RangeSpace() == newrng, TRUE);
part = GeObList(pt1, pt1);
AVector tout = mout(part);
truth((tout - (aaab - aaaa)).IsZeroVector(), TRUE);
// Map to a linear space:
VSpace vrng("vrng", 3, TRUE);
VBasis vb1 = vrng.StdBasis();
Vector vaaaa(vb1, ScalarList(0.0, 0.0, 3.4));
Vector vaaab(vb1, ScalarList(1.0, 1.0, 6.5));
Vector vaabb(vb1, ScalarList(1.5, 1.5, 1.2));
Vector vabbb(vb1, ScalarList(2.0, 0.7, 3.5));
Vector vbbbb(vb1, ScalarList(2.5, 1.0, 1.9));
GeObList vnet = GeObList(vaaaa, vaaab, vaabb) + GeObList(vabbb, vbbbb);
MAM vtstmp(domsp, hold, BasisList(mysimp), vrng, vnet);
// Test partial evaluation
part = GeObList(pt1, NullGeOb, NullGeOb, pt2 - pt1);
mout = vtstmp(inter, part);
truth(mout.FullyEvaluated(), FALSE);
truth(mout.DomainSpace() == inter, TRUE);
truth(mout.RangeSpace() == vrng, TRUE);
part = GeObList(pt1, pt1);
GeOb gout = mout(part);
truth((gout - (vaaab - vaaaa)).IsZeroVector(), TRUE);
truth(gout.Holds() == VECTOR, TRUE);
}